package com.huike.web.controller.business;

import com.huike.business.domain.TbBusiness;
import com.huike.business.domain.TbBusinessTrackRecord;
import com.huike.business.domain.vo.BusinessTrackVo;
import com.huike.business.service.ITbBusinessService;
import com.huike.business.service.ITbBusinessTrackRecordService;
import com.huike.common.core.domain.AjaxResult;
import com.huike.common.core.page.TableDataInfo;
import com.huike.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import com.huike.common.core.controller.BaseController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 商机跟进记录Controller
 *
 * @date 2021-04-28
 */
@RestController
@RequestMapping("/business/record")
public class TbBusinessTrackRecordController extends BaseController {
    @Autowired
    private ITbBusinessService tbBusinessService;
    @Autowired
    private ITbBusinessTrackRecordService tbBusinessTrackRecordService;

    //查询商机记录跟进记录表

    @GetMapping("list")
    public AjaxResult list(TbBusinessTrackRecord request) {
        List<TbBusinessTrackRecord> list = tbBusinessTrackRecordService.selectTbBusinessTrackRecordList(request);
       return AjaxResult.success(list);
    }
    //新增商机记录
    @PostMapping
    public AjaxResult addBusinessTrackRecord (@RequestBody BusinessTrackVo request){
        int result=tbBusinessTrackRecordService.addBusinessTrackRecord(request);
        return AjaxResult.success("添加成功");
    }

}
